<template>
  <el-form :inline="true" :model="formData" class="demo-form-inline">
    <el-form-item
      :label="metaItem.label"
      v-for="metaItem in formItemMetaList"
      :key="metaItem.key"
    >
      <DimensionItemContent
        :meta-item="metaItem"
        :common-attr="commonAttr"
        :form-data="formData"
      ></DimensionItemContent>
    </el-form-item>
    <el-form-item>
      <el-button-group>
          <el-button type="primary" :icon="RefreshLeft" @click="onReset"></el-button>
        <slot name="searchBtn"></slot>
      </el-button-group>
    </el-form-item>
  </el-form>
</template>
<script setup>
import { RefreshLeft } from "@element-plus/icons-vue";
import DimensionItemContent from "@gd-accbuild-ui/dimension-ui/dimension-item-content/dimension-item-content.vue";
import useSearchForm from "../../hooks/useSearchForm";
const props = defineProps({
  commonAttr: {
    type: Object,
  },
  formItemMetaList: {
    type: Array,
  },
  formData: {
    type: Object,
  },
});
const { onReset } = useSearchForm(props);
</script>
